<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 面向对象思想
        // 表现力的JSON 对象字面量
        // let 变量 关键字
        // key:value
        let person = {
            name:"qqq",//字符串 String
            hometown:'北京',
            age:20,//number 不适合计算 数值类型
            sex:'male',
            hobbies:['篮球','足球','音乐'],// object
            isSingle:true,
            job:null,
            sendFlower:function(target){
                target.receiveFlower(person);
            }
        }
        let xm ={
            name:"小美",
            hometown:'赣州',
            xq:30,
            receiveFlower:function(sender){
                console.log('小美收到了'+ sender.name +'花');
                if (this.xq<80){
                    console.log('你是个好人...');
                }
                else{
                    console.log('硕果走一波!!!');
                }
            
            }
        }
        let xh ={
            name:"小红",
            hometown:'上饶',
            receiveFlower:function(sender){
                setTimeout(function(){
                    xm.xq = 90;
                    xm.receiveFlower(sender);
                }
            )
                
                //console.log('小红收到了'+ sender.name +'花');
                //xm.receiveFlower(sender);
                //if(sender.name==='qqq'){
                //  console.log('让我们在一起吧...');
               // }
            }
        }
    </script>
</body>
</html>